package haltica.com.mx.ape.domain;

import java.util.Set;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.TableGenerator;
import javax.validation.constraints.NotNull;
import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooEntity(versionField = "", table = "sucursal")
public class Sucursal {

    @Id
    @TableGenerator(name = "GEN_SUC", table = "sequence", pkColumnName = "SEQ_NAME", valueColumnName = "SEQ_COUNT", pkColumnValue = "SEQ_SUC", allocationSize = 1)
	@GeneratedValue(strategy=GenerationType.TABLE, generator="GEN_SUC")
    @Column(name = "ID_SUCURSAL", columnDefinition = "INT UNSIGNED")
    private Integer idSucursal;

    @OneToMany(mappedBy = "idSucursal")
    private Set<EmpleadoSucursalTeclado> empleadoSucursalTecladoes;

    @OneToMany(mappedBy = "idSucursal")
    private Set<EncargadoTelefonoSucursal> encargadoTelefonoSucursals;

    @OneToMany(mappedBy = "idSucursal")
    private Set<Modem> modems;

    @ManyToOne
    @JoinColumn(name = "ID_CLIENTE", referencedColumnName = "ID_CLIENTE", nullable = false)
    private Cliente idCliente;

    @Column(name = "NOMBRE_SUCURSAL", columnDefinition = "VARCHAR", length = 80)
    @NotNull
    private String nombreSucursal;

    @Column(name = "NOMBRE_CORTO_SUCURSAL", columnDefinition = "VARCHAR", length = 15)
    @NotNull
    private String nombreCortoSucursal;

    @Column(name = "NOMBRE_CONTACTO", columnDefinition = "VARCHAR", length = 80)
    @NotNull
    private String nombreContacto;

    @Column(name = "EMAIL", columnDefinition = "VARCHAR", length = 50)
    private String email;

    @Column(name = "TELEFONO", columnDefinition = "VARCHAR", length = 14)
    @NotNull
    private String telefono;

    @Column(name = "DIRECCION", columnDefinition = "VARCHAR", length = 100)
    private String direccion;

    @Column(name = "CP", columnDefinition = "VARCHAR", length = 5)
    private String cp;

    @Column(name = "CIUDAD", columnDefinition = "VARCHAR", length = 20)
    private String ciudad;
}
